/* -------------------------------------------------------------------------- *
   TestWinUnit - Maria Blees (maria.blees@microsoft.com)

   File: TempFile.h
   This file/class is used in tests that require a temporary file to be 
   created, then deleted on exit.
 * -------------------------------------------------------------------------- */
#pragma once

#include <windows.h>

class TempFile
{
private:
    wchar_t _fullFileName[MAX_PATH];
    HANDLE _handle;
public:
    TempFile();
    TempFile(const wchar_t* directoryName, const wchar_t* fileName);
    virtual ~TempFile();
    operator HANDLE();

    __declspec (property(get=GetName))
    const wchar_t* Name;
    const wchar_t* GetName() const;

private:
    void CreateTempFile();
};

